package com.bajiao.entity.pay;

import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * <P>
 * 用途:支付回调数据vo
 * </p>
 *
 * @author: FanJq
 * @create: 2024-10-10
 **/
@Data
public class PayNotifyData implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 支付类型  1余额2微信3支付宝4优你分
     */
    private Integer type;
    /**
     * 扩展参数
     */
    private String params;

    /**
     * 支付宝交易号
     */
    private String tradeNo;

    /**
     * 支付数据来源、订单编号
     */
    private String outTradeNo;

    /**
     * 支付订单中金额
     */
    private String totalMoney;

    /**
     * 付款时间
     */
    private Date payTime;


    public static final class PayNotifyDataBuilder {
        private Integer type;
        private String params;
        private String tradeNo;
        private String outTradeNo;
        private String totalMoney;
        private Date payTime;

        private PayNotifyDataBuilder() {
        }

        public static PayNotifyDataBuilder aPayNotifyData() {
            return new PayNotifyDataBuilder();
        }

        public PayNotifyDataBuilder type(Integer type) {
            this.type = type;
            return this;
        }

        public PayNotifyDataBuilder params(String params) {
            this.params = params;
            return this;
        }

        public PayNotifyDataBuilder tradeNo(String tradeNo) {
            this.tradeNo = tradeNo;
            return this;
        }

        public PayNotifyDataBuilder outTradeNo(String outTradeNo) {
            this.outTradeNo = outTradeNo;
            return this;
        }

        public PayNotifyDataBuilder totalMoney(String totalMoney) {
            this.totalMoney = totalMoney;
            return this;
        }

        public PayNotifyDataBuilder payTime(Date payTime) {
            this.payTime = payTime;
            return this;
        }

        public PayNotifyData build() {
            PayNotifyData payNotifyData = new PayNotifyData();
            payNotifyData.setType(type);
            payNotifyData.setParams(params);
            payNotifyData.setTradeNo(tradeNo);
            payNotifyData.setOutTradeNo(outTradeNo);
            payNotifyData.setTotalMoney(totalMoney);
            payNotifyData.setPayTime(payTime);
            return payNotifyData;
        }
    }
}
